/*
 * @Author: zhangfeng
 * @Date: 2023-12-27 17:10:24
 * @LastEditTime: 2023-12-29 15:13:28
 * @LastEditors: zhangfeng
 * @Description:
 * @FilePath: \manager\managersystem\src\api\user.ts
 * © 2023 张峰，All rights reserved.
 */
import request from '../utils/request';

// 获取用户列表
export const getUserListAll = async () => {
	return request({
		url: '/users',
		method: 'get',
	});
};

// 添加用户/注册用户
export const createUser = async (query: UserQuery) => {
	return request({
		url: '/users/register',
		method: 'post',
		data: query,
	});
};

// 修改用户信息
export const updateUser = async (query: UserQuery) => {
	return request({
		url: '/users',
		method: 'patch',
		data: query,
	});
};

export const deleteUser = async (id: number) => {
	return request({
		url: '/users',
		method: 'delete',
		data: { id },
	});
};
